RestResponse.getBody

Returns the response body as a string representation following a RestServices call

The response body also contains the error message from a response if it is an unsuccessful call.

Example:

 var response = services.rest.get("http://example.com/rest/users");
 if(response.isSuccess())
 {
    var results = JSON.parse(response.getBody());
    if(results)
    {
      //do something with the results
    }
 }
 else
 {
    event.getOwner().addErrorMessage(response.getBody());
 }
 

returns java.lang.String